package qwer;

import java.util.Scanner;
import java.lang.Math;


public class NO2 {
	  public static void main(String[] args) {
		  Scanner in =new Scanner(System.in);
		  while (in.hasNextInt()) {
String b=in.next();
int a= Integer.parseInt(b); 
if(a>=10000&&a<=20000)	
{
	  System.out.print(Integer.toBinaryString(a)+",");
	  System.out.print(Integer.toOctalString(a)+",");  
	  System.out.println(Integer.toHexString(a)); 	 
 }
else
{  int c=0;
	String str=String.valueOf(a);
	if(a>=0){
for(int i=0;i<str.length();i++)
{
 System.out.print(str.charAt(i)+" ");
}
	}
	else
	{
		for(int i=1;i<str.length();i++)
		{
		 System.out.print(str.charAt(i)+" ");
		}
	}
	a=Math.abs(a);
		while(a>0){
			c+=a%10;
			a=a/10;
			}
			System.out.println(c);
			}
	}
	  }
}
